package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.enterpriseregistration.LindiEnterpriseRegistrationAuditVO;
import com.minimalist.common.entity.lindi.vo.enterpriseregistration.LindiEnterpriseRegistrationQueryVO;
import com.minimalist.common.entity.lindi.vo.enterpriseregistration.LindiEnterpriseRegistrationVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiEnterpriseRegistrationFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地企业注册 Feign 客户端
 *
 * @author minimalist
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiEnterpriseRegistrationFeignClient"
        , path = "/minimalist/lindi/enterpriseRegistration"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiEnterpriseRegistrationFeignClientFallbackFactory.class)
public interface LindiEnterpriseRegistrationFeignClient{

    /**
     * 添加企业注册信息
     *
     * @param enterpriseRegistrationVO 企业注册信息
     * @return 响应结果
     */
    @PostMapping("/addEnterpriseRegistration")
    @Operation(summary = "添加企业注册信息")
    R<?> addEnterpriseRegistration(@RequestBody @Validated(Add.class) LindiEnterpriseRegistrationVO enterpriseRegistrationVO);

    /**
     * 修改企业注册信息
     *
     * @param enterpriseRegistrationVO 企业注册信息
     * @return 响应结果
     */
    @PutMapping("/updateEnterpriseRegistrationByEnterpriseRegistrationId")
    @Operation(summary = "修改企业注册信息")
    R<?> updateEnterpriseRegistrationByEnterpriseRegistrationId(
            @RequestBody @Validated(Update.class) LindiEnterpriseRegistrationVO enterpriseRegistrationVO);

    /**
     * 删除企业注册信息
     *
     * @param enterpriseRegistrationId 企业注册ID
     * @return 响应结果
     */
    @DeleteMapping("/deleteEnterpriseRegistrationByEnterpriseRegistrationId")
    @Operation(summary = "删除企业注册信息 -> 根据企业注册信息ID删除")
    R<?> deleteEnterpriseRegistrationByEnterpriseRegistrationId(
            @RequestParam("enterpriseRegistrationId")
            @NotNull(message = "企业注册信息ID不能为空")
            @Parameter(name = "enterpriseRegistrationId", required = true, description = "企业注册信息ID")
            Long enterpriseRegistrationId);

    /**
     * 获取企业注册详情
     *
     * @param enterpriseRegistrationId 企业注册ID
     * @return 企业注册详情
     */
    @GetMapping("/getEnterpriseRegistrationByEnterpriseRegistrationId/{enterpriseRegistrationId}")
    @Operation(summary = "根据企业注册信息ID查询企业注册信息")
    R<LindiEnterpriseRegistrationVO> getEnterpriseRegistrationByEnterpriseRegistrationId(
            @PathVariable("enterpriseRegistrationId")
            @NotNull(message = "企业注册信息ID不能为空")
            @Parameter(name = "enterpriseRegistrationId", description = "企业注册信息ID", required = true)
            Long enterpriseRegistrationId);

    /**
     * 分页查询企业注册列表
     *
     * @param queryVO 查询条件
     * @return 企业注册列表
     */
    @GetMapping("/getPageEnterpriseRegistrationList")
    @Operation(summary = "查询企业注册信息列表(分页)")
    R<PageResp<LindiEnterpriseRegistrationVO>> getPageEnterpriseRegistrationList(
            @RequestBody LindiEnterpriseRegistrationQueryVO queryVO);

    /**
     * 审核企业注册信息
     *
     * @param auditVO 审核信息
     * @return 响应结果
     */
    @PostMapping("/auditEnterpriseRegistration")
    @Operation(summary = "审核企业注册信息")
    R<?> auditEnterpriseRegistration(
            @RequestBody @Validated(Update.class) LindiEnterpriseRegistrationAuditVO auditVO);
}